<?php $this->load->view('includes/header'); ?>
<div class="container">
    <div class="row">
	   <div class="col-md-9">
		  <h1>Panel de Control <small>Listado de Videos</small></h1>
		  <hr>
		  <?php if (isset($error) && $error): ?>
    		  <div class="alert alert-info alert-dismissable">
    			 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
				<?php
				if (isset($msg) && $msg != ' ') {
				    echo $msg;
				}
				?>
    		  </div>

		  <?php endif ?>
		  <table class="table table-bordered table-hover tablesorter">
                <thead>
				<tr>
				    <th>Youtube <i class="fa fa-sort"></i></th>
				    <th>Titulo <i class="fa fa-sort"></i></th>
				    <th>Duración <i class="fa fa-sort"></i></th>
				    <th>Iframe <i class="fa fa-sort"></i></th>
				    <th width="16px"><a data-toggle="modal" href="#myModal" ><i class="fa fa-plus-square-o"></i></a></th>
				</tr>
                </thead>
                <tbody>
				<?php foreach ($videos as $video): ?>
                        <tr>
    				    <td><?php echo $video['id_youtube']; ?></td>
    				    <td><?php echo $video['titulo']; ?></td>
				    <td><?php echo $video['duracion']; ?></td>
    				    <td><?php echo $video['iframe']; ?></td>
    				    <td> 
    					   <a href="/fotos/eliminar/<?php echo $video['id_youtube']; ?>/" title="Eliminar imagen"><i class="fa fa-trash-o"></i></a>
    				    </td>
                        </tr>
				<?php endforeach; ?>
                </tbody>
		  </table>
	   </div>
    </div>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
	   <div class="modal-content">
		  <div class="modal-header">
			 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			 <h4 class="modal-title" id="myModalLabel">Agregar Foto</h4>
		  </div>
		  <form role="form" class="form_add" id="form_add_artista" action="/fotos/insertar/<?php echo $cod_pelicula; ?>" method="post">
			 <div class="modal-body">
				<div class="row">
				    <div class="form-group col-md-3">
					   <label>URL</label>
					   <input class="form-control" name="url" > 
				    </div>
				    <div class="form-group col-md-9">
					   <label>TITULO</label>
					   <input type="text" class="form-control input_width10" name="titulo"> 
				    </div>
				</div>
			 </div>
			 <div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
				<button type="submit" class="btn btn-primary">Añadir</button>
			 </div>
		  </form>
	   </div>
    </div>
</div>				

<?php $this->load->view('includes/footer'); ?>